{include file="system@block/layui" /}

<table class="layui-table" lay-even="" lay-skin="row" totalRow='true'>
  <colgroup>
    <col width="200">
    <col width="200">
    <col width="200">
    <col width="200">
    <col width="200">
    <col width="200">
    <!-- <col width="200">
    <col width="200"> -->
    <col>
  </colgroup>
  <thead>
    <tr>
      <th>产品名称</th>
      <th>供应商</th>
      <th>规格</th>
      <th>单位</th>
      <th>数量</th>
      <!-- <th>采购单价</th>
      <th>采购金额</th> -->
      <th>备注</th>
    </tr>
  </thead>
  <tbody>
  {volist name="products" id="vo"}
    <tr>
      <td>{$vo.name|default=""}</td>
      <td>{$vo.supplier_text|default=""}</td>
      <td>{$vo.specs|default=""}</td>
      <td>{$vo.unit_text|default=""}</td>
      <td>{$vo.num|default=""}</td>
      <!-- <td>{$vo.price1|default=""}</td>
      <td>{$vo.jine|default=""}</td> -->
      <td>{$vo.bak|default=""}</td>
    </tr>
	{/volist}
  <!-- <tr><td align="center">合计</td><td align="center"></td><td align="center"></td><td align="center"></td><td align="center"></td><td align="center"></td><td align="center">
  {$zong}
  </td><td align="center"></td></tr> -->
  </tbody>
</table>
{if($type == 0)}
<form class="layui-form" action="{:url()}" method="post" id="editForm">
    <div class="layui-form-item">
        <div class="layui-input-block">
            <a data-href="{:url('status')}?id={$id}&val=2" refresh="false" class="qty-ajax layui-btn layui-btn-normal">审核通过</a>
            <a data-href="{:url('status')}?id={$id}&val=3" refresh="false" class="qty-ajax layui-btn layui-btn-primary ml10">审核不通过</a>
        </div>
    </div>
</form>
{/if}
<script src="__STATIC__/js/jquery.2.1.4.min.js"></script>
<script>
$(document).on('click','.qty-ajax',function(){
  var url = $(this).data('href');
  console.log(url);
    $.ajax({
      url: url,
      type:'get',
      success:function(res){
          layer.msg('审核完成！',function(){
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
              parent.layer.close(index); //再执行关闭
                            // layer.close(layer.index);
              window.parent.location.reload();
          })
      }
    })
})
</script>
